package com.example.dong.clients;

import com.example.dong.clients.configuration.SomethingClientConfig;
import com.example.dong.clients.fallback.SomeClientFallbackFactory;
import com.example.dong.clients.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(name = "app-order",
        url = "http://localhost:8081/api/some",
        configuration = SomethingClientConfig.class,
        fallbackFactory = SomeClientFallbackFactory.class)
public interface SomethingClient {

    /**
     * 详情
     * @param id 主键
     * @return 描述
     */
    @GetMapping("detail/{id}")
    Result<String> detail(@PathVariable("id") int id);

    @GetMapping("fallback")
    Result<String> fallback();

    @GetMapping("say")
    String say();
}
